import { Layout, Menu } from 'antd';
import React, { useEffect } from 'react';
import useRouter from 'hooks/use-router';

const { Sider, Content } = Layout
const HomePage = (props: any) => {
    const router = useRouter()
    useEffect(() => {
      router.push('/monitor')
      return () => {}
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [])

    return (
        <Layout style={{ height: '100vh'}}>
            <Sider>
                <Menu theme="dark" mode="inline" defaultSelectedKeys={['monitor']}>
                    <Menu.Item key={'monitor'} onClick={() => router.push('/monitor')}>真机监控</Menu.Item>
                </Menu>
            </Sider>
            <Content>
                {props.children}
            </Content>
        </Layout>
    )
}
export default HomePage